<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('hello/:name', 'index/hello');
Route::rule('login', 'Login/login');

Route::rule('login', 'Login/login');

Route::group('', function () {
    //更新用户数据
    Route::rule('update_userinfo', 'User/updateUser');
    //更新用户手机号
    Route::rule('update_phone', 'User/updateUserPhone');
    //获取个人信息
    Route::rule('get_user_info', 'User/getUserInfo');
    #个人中心页面数据
    Route::rule('user_center', 'User/userCenter');
    #用户搜索
    Route::rule('user_search', 'User/UserSearch');
    #根据手机号用户搜索
    Route::rule('user_search_by_phone', 'User/userSearchByPhone');
    #根据用户id搜索
    Route::rule('user_search_by_id', 'User/userSearchById');

    #首页查看积分详情,查看积分都是在哪些商家可用
    Route::rule('user_point_list', 'Home/userShopPointList');

    //店铺管理  商圈店铺管理
    Route::rule('shop_list', 'Shop/shopList');
    //店铺详情  商圈店铺详情
    Route::rule('shop_detail2', 'Shop/shopDetail2');
    //店铺信息修改
    Route::rule('shop_detail_update', 'Shop/shopDetailUpdate');

    //店铺管理员退出当前店铺
    Route::rule('shop_manage_exit', 'Shop/shopExit');
    //获取店铺中我的信息(暂未使用 0824)
    Route::rule('shop_mine_info', 'Shop/shopMeInfo');
    //店铺管理员(店长)
    Route::rule('shop_admin_list', 'Shop/shopAdminList');
    //店铺管理--管理员新增
    Route::rule('shop_manage_add', 'Shop/shopManageAdd');
    //店铺管理--管理员更新
    Route::rule('shop_manage_update', 'Shop/shopManageUpdate');
    //删除
    Route::rule('shop_manage_delete', 'Shop/shopManageDelete');
    //店铺分享海报
    Route::rule('shop_share_post', 'Shop/sharePost');
    //店铺会员列表
    Route::rule('shop_user_list', 'Shop/shopUserList');

    //获取店铺分享图片
    Route::rule('shop_share_img', 'Shop/getShopShareImg');


    ###商圈相关###
    //商圈搜索
    Route::rule('district_search', 'District/districtSearch');
    //商圈详情
    Route::rule('district_detail', 'District/districtDetail');
    //商圈店铺分类下的店铺列表
    Route::rule('district_shop_list', 'District/districtShopList');
    //商圈店铺添加
    Route::rule('district_shop_add', 'District/shopAdd');
    //商圈店铺删除
    Route::rule('district_shop_delete', 'District/shopDelete');

    //添加商圈时获取商圈列表
    Route::rule('district_list', 'District/districtList');

    //添加商圈管理员
    Route::rule('district_admin_add', 'District/adminAdd');
    //编辑
    Route::rule('district_admin_edit', 'District/adminEdit');

    //商圈中 我的信息
    Route::rule('district_mine_info', 'District/districtMeInfo');
    //商圈管理员列表
    Route::rule('district_admin_list', 'District/adminList');
    //商圈管理员删除
    Route::rule('district_admin_delete', 'District/adminDelete');
    //商圈管理员退出商圈
    Route::rule('district_admin_exit', 'District/districtExit');

    //商圈结算
    Route::rule('district_settlement', 'District/districtSettlement');
    //商圈店铺详情
    Route::rule('district_shop_detail', 'District/districtShopDetail');
    //店铺退出 商圈/连锁
    Route::rule('district_shop_exit', 'District/shopExit');
    //商圈管理
    //商圈详情获取
    Route::rule('district_info', 'District/districtInfo');
    //商圈信息修改
    Route::rule('district_info_update', 'District/districtInfoUpdate');


    //店铺管理 =-
    //商品管理
    //获取店铺商品库列表
    Route::rule('shop_library', 'Goods/GoodsLibrary');
    //获取商品库中所有商品
    Route::rule('shop_library_goods', 'Goods/GoodsList');
    //添加商品到店铺
    Route::rule('add_goods_to_shop', 'Goods/addGoodsToShop');
    //商品上下架状态修改
    Route::rule('goods_sale_change', 'Goods/goodsIsSaleChange');


    //首页数据
    Route::rule('home', 'Home/home');
    //上传图片
    Route::rule('upload', 'Home/upload');
    //搜索
    Route::rule('search', 'Home/search');
    //获取店铺详情
    Route::rule('shop_detail', 'Shop/shopDetail');
    //获取店铺首页产品列表
    Route::rule('shop_product_list', 'Shop/shopProduct');

    //商品详情
    Route::rule('goods_detail', 'Goods/goodsDetail');

    //商品上传
    Route::rule('goods_upload', 'Goods/goodsCreate');
    //商品修改
    Route::rule('goods_update', 'Goods/goodsUpdate');
    //商品删除
    Route::rule('goods_delete', 'Goods/goodsDelete');

    //根据商家获取店铺列表
    Route::rule('business_points_detail', 'Shop/getBusinessPoints');


//    //根据商圈获取商家列表
    Route::rule('shop_list_by_district', 'District/shopList');


    //赠送积分
    Route::rule('send_points', 'Shop/sendPoints');


    //订单确认页面
    Route::rule('order_sure', 'Order/orderSure');
    //兑换商品
    Route::rule('order_create', 'Order/orderCreate');

    //订单中心
    Route::rule('order_list', 'Order/orderList');
    Route::rule('order_detail', 'Order/orderDetail');

    Route::rule('ticket_list', 'Order/ticketList');
    Route::rule('ticket_code', 'Order/getCode');

    //退款
    Route::rule('order_refund', 'Order/refund');
    Route::rule('order_refund_prompt', 'Order/refundPrompt');
    //平台产品退款
    Route::rule('platform_order_refund', 'Order/orderRefund');


    //商家订单列表
    Route::rule('shop_order_list', 'Order/shopOrderList');

    //确认收货
    Route::rule('get_goods', 'Order/getGoods');
    //商家确认货已到店
    Route::rule('shop_get_goods', 'Order/shopGetGoods');
    //检查订单状态
    Route::rule('check_order_status', 'Order/checkOrderStatus');

    //添加地址
    Route::rule('address_add', 'Order/addressAdd');
    Route::rule('address_delete', 'Order/addressDelete');
    Route::rule('set_default', 'Order/setDefault');
    Route::rule('address_list', 'Order/myAddressList');
    Route::rule('address_edit', 'Order/addressEdit');

    //钱包 --我的积分信息
    Route::rule('my_points', 'User/myPoints');
    Route::rule('points_log', 'User/pointsLog');

    //商家入驻
    Route::rule('shop_apply', 'Shop/apply');

    //商品分类
    Route::rule('category_list', 'Shop/categoryList');

    //商品列表
    Route::rule('product_list', 'Shop/productList');


    //积分转换
    Route::rule('points_exchange', 'Shop/pointsExchange');

    //商家积分核算
    Route::rule('check_points', 'Shop/checkPoints');

    //商家积分核算
    Route::rule('settlement_district', 'Shop/settlementDistrict');

    //商家详情页面接口  商圈管理员给店铺核算的页面接口
    Route::rule('shop_check_detail', 'Shop/shopCheckDetail');

    //商家积分汇总
    Route::rule('shop_points_summary', 'Shop/shopPointsSummary');
    //商家积分流水
    Route::rule('shop_points_log', 'Shop/shopPointsLog');
    //商家积分流水 下载excel
    Route::rule('shop_points_log_download', 'Shop/export');


    //生成小程序码
    Route::rule('share_code', 'Shop/getShareCode');

    //获取地址列表
    Route::rule('area', 'Home/getAreaList');

    //生成海报
    Route::rule('share_post', 'Goods/sharePost');

    //浏览历史
    Route::rule('visit_log', 'User/visitLog');
    //浏览历史删除
    Route::rule('visit_log_delete', 'User/visitLogDelete');

})->middleware(\app\api\middleware\CheckToken::class);